<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head> 
    <meta charset="UTF-8">
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
    <link rel="stylesheet" href="${ctxStatic}/css/layerSm.css">
   
    <script>
   

    $(function(){
        $(".tabBox ul li").each(function(){
            var index=$(this).index();

            $(".tabBox ul li").eq(0).addClass("active");

            $(this).click(function(){

                $(this).addClass("active").siblings().removeClass("active");

                $(".tabBoxSm > .tabSm").eq(index).stop(true).show().siblings().stop(true).hide();
				
				var tableW = $(".tabBoxSm > .tabSm").eq(index).find('.tableHead').width();
				var tabodyH = $(".tabBoxSm > .tabSm").eq(index).find('.tableBody').height();
				var tableScrollH = $(".tabBoxSm > .tabSm").eq(index).find('.tableScroll').height();
				if(tabodyH>tableScrollH){
					$(".tabBoxSm > .tabSm").eq(index).find('.tableScroll').css('width',tableW + 18 + 'px');
				}else{
					$(".tabBoxSm > .tabSm").eq(index).find('.tableScroll').css('width','inherit');
				}
            });
        });
        $("select").select2();
        
        
    });
    
    //删除方法
    function delBookingOrders(){
    	if (confirm("确定删除吗？")) {
           // 调用后台删除方法
	        $.post("${ctx}/bookingspace/single/delete?id=${bookingOrders.id}",'',function(result){
	             // 提示信息
	             tipParent(result.message);
	             // 返回状态
	            if(result.statusCode==STATUSCODEOK){
	                 // 刷新页面
	                window.parent.frames[0].searchListForm();
	                 // 关闭页面
	                closeWin(); 
	             }
	        },'json');
    	}
   }
    
  //提交 方法
    function commitBookingOrders(){
	  if (confirm("确定提交吗？")) {
          // 调用后台提交方法
        $.post("${ctx}/bookingspace/single/commit?id=${bookingOrders.id}","",function(result){
             // 提示信息
             tipParent(result.message);
             // 返回状态
            if(result.statusCode==STATUSCODEOK){
                 // 刷新页面
                window.parent.frames[0].searchListForm();
                 // 关闭页面
                closeWin(); 
             }
        },'json');
	}
   }
    </script> 
</head>
<body>
<!-- 查看头部 -->   
<div class="layerHeader clearfix">
	<p class="headerTitle"><spring:message code="Bookingorders_show_title"/></p>
    <div class="headerButton clearfix">
    <c:if test="${bookingOrders.deleteFlag==0}">    
    <%-- <shiro:hasPermission name="bookingspace:single:audit">	   	 	
    	<!-- 审核按钮 -->
    	<button type="button" onclick="popup('800px','519px','${ctx}/bookingspace/single/audit?id=${bookingOrders.id}')"><spring:message code="purchaseContract_edit_audit"/></button>
    </shiro:hasPermission> --%>
    <shiro:hasPermission name="bookingspace:single:edit">
    	<c:if test="${bookingOrders.bookingordersStatus eq '0'}">
    	<!-- 提交按钮 -->
        <button type="button" onclick="commitBookingOrders();">提交</button>	
    	<!-- 删除按钮 -->
        <button type="button" onclick="delBookingOrders();"><spring:message code="purchaseContract_edit_delete"/></button>
        <!-- 编辑按钮 -->
        <%-- <button type="button" onclick="window.location.href='${ctx}/bookingspace/single/editbookorder?id=${bookingOrders.id}'"><spring:message code="write_style_btn"/></button>  --%>  	
    	</c:if>
    </shiro:hasPermission>
    </c:if>
    	<!-- 取消按钮 -->
        <button type="button" onclick="closeWin()"><spring:message code="purchaseContract_edit_cancle"/></button>
    </div>
</div>


<div id="showHtml" class="smOrderBox">
 <div class="tabSm smOrderBox showHtml">
    <div class="items clearfix">
        		<div class="col-33 clearfix haveToBox" style="left:80px">
        		<!-- 收件公司 -->
            		<p class="tit"><spring:message code="Bookingorders_Receipt_company"/></p>
          			<input text="hidden" value="${bookingOrders.ognizationNameB}" style="width: 200px" disabled="disabled">
        		</div>        
        		<div class="col-33 clearfix haveToBox" style="left:150px">
        		<!-- 委托公司  -->
            		<p class="tit"><spring:message code="Bookingorders_Entrust_company"/></p>               
                	<input text="hidden" value="<spring:message code="Bookingorders_company" />" style="width: 130px" disabled="disabled">            
        		</div>        
    </div>
    <div class="items clearfix">
        		<div class="col-33 clearfix haveToBox" style="left:80px">
        		<!-- 收件地址  -->
            		<p class="tit"><spring:message code="Bookingorders_Receives_address"/></p>            	
            		<input text="hidden" value="${bookingOrders.ognizationAddressB}" style="width: 230px" disabled="disabled">
            
        		</div>
        		<div class="col-33 clearfix haveToBox" style="left:150px">
        		<!-- 交货条件  -->
            		<p class="tit"><spring:message code="Bookingorders_Termsofdelivery"/></p>             	
             		<input text="hidden" value="${bookingOrders.termsofDelivery}" style="width: 200px" disabled="disabled">
        		</div>
   </div>
    <div class="items clearfix" >        	
        		<div class="col-33 clearfix haveToBox" style="left:80px">        			
        		<!-- 主联系人  -->
            		<p class="tit"><spring:message code="Bookingorders_main_contact"/></p>              		
               		<input text="hidden" value="${bookingOrders.contactPersonB}" style="width: 200px" disabled="disabled">         			
                </div>
                <div class="col-33 clearfix haveToBox" style="left:150px">
                <!-- 装货港  -->
                    <p class="tit"><spring:message code="Bookingorders_portofloading"/></p>                   
                    <input text="hidden" value="${bookingOrders.portoFloading}" style="width: 80px" disabled="disabled">
                </div>
                <div class="col-33 clearfix haveToBox" style="left:0px">
                <!-- 目的港  -->
                    <p class="tit"><spring:message code="Bookingorders_portofdestination"/></p>                    
                    <input text="hidden" value="${bookingOrders.portoFdestiNation}" style="width: 80px" disabled="disabled">
                </div>
    </div>    
    <div class="items clearfix">        	
                <div class="col-33 clearfix haveToBox" style="left:80px">
                <!-- 联系电话  -->
                    <p class="tit"><spring:message code="Bookingorders_Contact_phone"/></p>                    
                    <input text="hidden" value="${bookingOrders.contactPhoneB}" style="width: 200px" disabled="disabled">
                </div>
                <div class="col-33 clearfix haveToBox" style="left:150px">
                <!-- 运输方式  -->
           			 <p class="tit"><spring:message code="Bookingorders_mode_transportation"/></p>                       
                        <input text="hidden" value="${fns:getDictName(bookingOrders.transportMode)}" style="width: 80px" disabled="disabled">                        
            	 </div>
            	  <div class="col-33 clearfix haveToBox">
        		<!-- 订舱费用  -->
            		<p class="tit"><spring:message code="Bookingorders_Bookingfee"/></p>            		
            		<input text="hidden" value="<fmt:formatNumber value="${bookingOrders.bookingFee}" pattern="#,##0.00"/>" style="width: 80px" disabled="disabled">
         		  </div>
     </div>         	
     <div class="items clearfix" id="divCount">                       
                <div class="haveToBox" style="left:80px">
                 <!--总件数 -->
                    <p class="tit" style="color: red;width:120px;"><spring:message code="Bookingorders_totalnumber" /><span class="spanTotalnumber"><fmt:formatNumber value="${bookingOrders.totalNumber}" pattern="#,##0"/></span></p>
                </div>
                <div class="haveToBox" style="left:150px">
                 <!-- 总箱数 -->
                    <p class="tit" style="color: red;width:120px;"><spring:message code="Bookingorders_totalnumberofcases"/><span class="spanTotalnumberofcases"><fmt:formatNumber value="${bookingOrders.totalNumberofcases}" pattern="#,##0"/></span></p>
                </div>
                <div class="haveToBox" style="left:230px">
        		 <!-- 总毛重 -->
                    <p class="tit" style="color: red;width:120px;"><spring:message code="Bookingorders_Totalgrossweight" /><span class="spanTotalgrossweight"><fmt:formatNumber value="${bookingOrders.totalWeight}" pattern="#,##0.00"/></span></p>
   				</div>
   				 <div class="haveToBox" style="left:300px">
        		 <!-- 总体积 -->
                    <p class="tit" style="color: red;width:120px;"><spring:message code="Bookingorders_totalvolume" /><span class="spanTotallvolume"><fmt:formatNumber value="${bookingOrders.totalVolume}" pattern="#,##0.00"/></span></p>
   				</div>	
   		    		              
	</div>
</div>

		<div class="tabBoxSm">
		    <div class="tabSm">
		    	<div class="tableArea">
		        	<div class="tableScrollSm" style="width:910px;height:387px;overflow: auto;">
		        		<table cellpadding="0" class="tableHead">
		                    <thead>
		                    <tr>
		                    	<th><p class="tab-htddh" style="width: 100px"><spring:message code="Bookingorders_PackinglistNo" /></p></th>
				                <th><p class="tab-htddh" style="width: 100px"><spring:message code="contractorder_ID" /></p></th>
				                <th><p class="tab-ksbh" style="width: 120px"><spring:message code="Bookingorders_stylenumber" />/<spring:message code="Bookingorders_stylename" /></p></th>
				                <th><p class="tab-jhrq" style="width: 70px"><spring:message code="Bookingorders_deliverydate" /></p></th>
				                <th><p class="tab-rkrq" style="width: 70px"><spring:message code="Bookingorders_Inbounddate" /></p></th>
				                <th><p class="tab-gb" style="width: 70px"><spring:message code="Bookingorders_country" /></p></th>
				                <th><p class="tab-xs" style="width: 70px"><spring:message code="Bookingorders_numberofcases" /></p></th>
				                <th><p class="tab-js" style="width: 70px"><spring:message code="Bookingorders_number" /></p></th>
				                <th><p class="tab-mz" style="width: 70px"><spring:message code="Bookingorders_grossweight" /></p></th>
				                <th><p class="tab-tj" style="width: 70px"><spring:message code="Bookingorders_volume" /></p></th>
				                <th class="tab-bz" style="width: 70px"><spring:message code="Bookingorders_note" /></th>
		                    </tr>
		                    </thead>
		                </table>
		                 <!-- 订舱单明细 -->
		                <table cellpadding="0" class="tableBody">
							<c:if test="${not empty bookingOrders.bookingOrderList}">
								<tbody>
									<c:forEach items="${bookingOrders.bookingOrderList}" var="booking" varStatus="importStatus">
										<tr>
											<!-- 装箱单号 -->
											<td><p style="width:100px">${booking.packageNo}</p></td>											
											<!-- 合同订单编号 -->
											<td><p style="width:100px">${booking.customerContractNo}</p></td>											
											<!-- 款式编号/款式名称 -->
											<td><p style="width: 120px">${booking.styleCustomerNo}<br>${booking.styleNameCn}</p></td>																						
											<!-- 交货日期 -->
											<td><p style="width: 70px"><fmt:formatDate value="${booking.deliveryDate}" pattern="yyyy-MM-dd"/></p></td>											
											<!-- 入库日期 -->
											<td><p style="width: 70px"><fmt:formatDate value="${booking.inboundDate}" pattern="yyyy-MM-dd"/></p></td>											
											<!-- 国别 -->
											<td><p style="width: 70px">${fns:getDictName(booking.countryCd)}</p></td>											
											<!-- 箱数 -->
											<td><p style="width: 70px"><fmt:formatNumber value="${booking.packageQuantity}" pattern="#,##0.00###"/></p></td>											
											<!-- 件数 -->
											<td><p style="width: 70px"><fmt:formatNumber value="${booking.packageStyleQuantity}" pattern="#,##0.00###"/></p></td>
											<!-- 毛重 -->
											<td><p style="width: 70px"><fmt:formatNumber value="${booking.packageRoughWeight}" pattern="#,##0.00###"/></p></td>											
											<!-- 体积 -->
											<td><p style="width: 70px"><fmt:formatNumber value="${booking.packageVolume}" pattern="#,##0.00###"/></p></td>                                            
											<!-- 备注 -->
											<td><p style="width: 70px" class='text_overflow' data-toggle='tooltip' title='${booking.noteRemarks}'>${booking.noteRemarks}</p></td>
										</tr>
									</c:forEach>
								</tbody>
							</c:if>
						</table>
		            </div>
		        </div>
			</div>		
		</div>
</div>		
</body>
</html>